home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / ansi / m68k / setjmp.h < prev    next >
C/C++ Source or Header  |  1992-12-12  |  3KB  |  128 lines

  1. /* Copyright (c) 1992, NeXT Computer, Inc.  All rights reserved.
  2.  *
  3.  *    File:    setjmp.h
  4.  *
  5.  *    Declaration of setjmp routines and data structures.
  6.  */
  7.  
  8. #ifndef _ANSI_M68K_SETJMP_H
  9.     #define _ANSI_M68K_SETJMP_H
  10.  
  11.     #include <standards.h>
  12.  
  13.     #if !defined(__STRICT_ANSI__) && !defined(_POSIX_SOURCE)
  14.         /*
  15.          * WARNING: the first portion of this must match a
  16.          *          struct sigcontext
  17.          */
  18.         #define    JB_ONSTACK    0
  19.         #define    JB_SIGMASK    1
  20.         #define    JB_SP        2
  21.         #define    JB_PC        3
  22.         #define    JB_PS        4
  23.         #define JB_D0        5
  24.         /* from here on down, independent of struct sigcontext */
  25.         #define    JB_D2        6
  26.         #define    JB_D3        7
  27.         #define    JB_D4        8
  28.         #define    JB_D5        9
  29.         #define    JB_D6        10
  30.         #define    JB_D7        11
  31.         #define    JB_A2        12
  32.         #define    JB_A3        13
  33.         #define    JB_A4        14
  34.         #define    JB_A5        15
  35.         #define    JB_A6        16
  36.         #define    JB_FP2        17
  37.         #define    JB_FP3        20
  38.         #define    JB_FP4        21
  39.         #define    JB_FP5        26
  40.         #define    JB_FP6        29
  41.         #define    JB_FP7        32
  42.         #define    JB_FPCR        35
  43.         #define    JB_FPSR        36
  44.         #define    JB_FPIAR    37
  45.         #define    JB_MAGIC    38
  46.         #define    JB_NREGS    (JB_MAGIC+1)
  47.  
  48.         #define    JB_MAGICNUM    0xbeeffeed
  49.  
  50.         #if !defined(LOCORE) && !defined(ASSEMBLER)
  51.             typedef int jmp_buf[JB_NREGS];
  52.  
  53.             #ifndef __STRICT_BSD__
  54.                 extern int setjmp(jmp_buf env);
  55.                 #ifdef    __GNUC__
  56.                     extern volatile void \
  57.                         longjmp(jmp_buf env, int val);
  58.                 #else
  59.                     extern void \
  60.                         longjmp(jmp_buf env, int val);
  61.                 #endif /* __GNUC__ */
  62.             #endif /* __STRICT_BSD__ */
  63.         #endif /* !LOCORE && !ASSEMBLER */
  64.     #else /* ! __STRICT_ANSI__ && ! _POSIX_SOURCE */
  65.         /*
  66.          * WARNING: the first portion of this must match a struct
  67.          *        sigcontext
  68.          */
  69.         #define    _SJB_ONSTACK    0
  70.         #define    _SJB_SIGMASK    1
  71.         #define    _SJB_SP        2
  72.         #define    _SJB_PC        3
  73.         #define    _SJB_PS        4
  74.         #define _SJB_D0        5
  75.         /* from here on down, independent of struct sigcontext */
  76.         #define    _SJB_D2            6
  77.         #define    _SJB_D3            7
  78.         #define    _SJB_D4            8
  79.         #define    _SJB_D5            9
  80.         #define    _SJB_D6            10
  81.         #define    _SJB_D7            11
  82.         #define    _SJB_A2            12
  83.         #define    _SJB_A3            13
  84.         #define    _SJB_A4            14
  85.         #define    _SJB_A5            15
  86.         #define    _SJB_A6            16
  87.         #define    _SJB_FP2        17
  88.         #define    _SJB_FP3        20
  89.         #define    _SJB_FP4        21
  90.         #define    _SJB_FP5        26
  91.         #define    _SJB_FP6        29
  92.         #define    _SJB_FP7        32
  93.         #define    _SJB_FPCR        35
  94.         #define    _SJB_FPSR        36
  95.         #define    _SJB_FPIAR        37
  96.         #define _SJB_USE_SIGMASK    38
  97.         #define    _SJB_MAGIC        39
  98.         #define    _SJB_NREGS    (_SJB_MAGIC+1)
  99.  
  100.         #define    _SJB_MAGICNUM    0xdeafbeef
  101.         #if !defined(LOCORE) && !defined(ASSEMBLER)
  102.             typedef int jmp_buf[39];
  103.  
  104.             #ifdef __STDC__
  105.                 extern int setjmp(jmp_buf env);
  106.                 extern void longjmp(jmp_buf env, int val);
  107.             #else
  108.                 extern int setjmp();
  109.                 extern void longjmp();
  110.             #endif /* __STDC__ */
  111.  
  112.             #ifdef _POSIX_SOURCE
  113.                 typedef int sigjmp_buf[_SJB_NREGS];
  114.                 #ifdef __STDC__
  115.                     extern void \
  116.                         siglongjmp(sigjmp_buf env, int val);
  117.                     extern int \
  118.                     sigsetjmp(sigjmp_buf env, int savemask);
  119.                 #else
  120.                     extern void siglongjmp();
  121.                     extern int sigsetjmp();
  122.                 #endif /* __STDC__ */
  123.             #endif /* _POSIX_SOURCE */
  124.             
  125.         #endif /* !LOCORE && !ASSEMBLER */
  126.     #endif /* ! __STRICT_ANSI__ && ! _POSIX_SOURCE */
  127. #endif /* _ANSI_M68K_SETJMP_H */
  128.